<template>
  <div>
    <p>会员套餐</p>
    <div class="box">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    <button @click="getVip">立即开通</button>
    <van-checkbox v-model="checked" class="agree"
      >阅读并同意《付费会员服务协议》</van-checkbox
    >
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  data() {
    return {
      //是否同意
      checked: false,
    };
  },
  methods: {
    ...mapActions("li", ["openVip"]),
    //开通会员
    getVip() {
      if (this.checked) {
        this.openVip();
      }
    },
  },
};
</script>

<style lang="scss" scoped>
p {
  width: 128px;
  height: 44px;
  color: rgba(16, 16, 16, 100);
  font-size: 32px;
  text-align: left;
  font-family: PingFangSC-regular;
  margin-left: 82px;
  margin: 62px 0 40px 82px;
}
.box {
  margin: 0 auto;
  display: flex;
  width: 640px;
  justify-content: space-around;
  div {
    width: 114px;
    height: 136px;
    line-height: 40px;
    border-radius: 12px;
    background-color: rgba(190, 190, 190, 100);
    text-align: center;
    border: 2px solid rgba(187, 187, 187, 100);
  }
}
button {
  display: block;
  margin: 86px auto 20px;
  left: 82px;
  top: 778px;
  width: 590px;
  height: 88px;
  border-radius: 26px;
  background-color: rgba(255, 255, 255, 100);
  color: rgba(16, 16, 16, 100);
  font-size: 28px;
  text-align: center;
  font-family: Microsoft Yahei;
  border: 2px solid rgba(187, 187, 187, 100);
}

.agree {
  justify-content: center;
}
</style>